<template>
  <el-aside :width="$store.state.isCollapse ? '64px' : '210px'">
    <el-menu
      :collapse="$store.state.isCollapse"
      :collapse-transition="false"
      :router="true"
      :default-active="route.fullPath"
    >
      <el-menu-item index="/index">
        <el-icon><home-filled /></el-icon>
        <span>首页</span>
      </el-menu-item>
      <el-menu-item index="/center">
        <el-icon><home-filled /></el-icon>
        <span>个人中心</span>
      </el-menu-item>
      <el-sub-menu index="/notice">
        <template #title>
          <el-icon><location /></el-icon>
          <span>通知管理</span>
        </template>
        <el-menu-item-group title="">
          <el-menu-item index="/notice/noticeAdd">创建通知</el-menu-item>
          <el-menu-item index="/notice/noticeList">通知列表</el-menu-item>
        </el-menu-item-group>
      </el-sub-menu>
    <el-menu-item index="/order">
        <el-icon><home-filled /></el-icon>
        <span>订单管理</span>
      </el-menu-item>
      <el-menu-item index="/adminConfig">
        <el-icon><home-filled /></el-icon>
        <span>配置管理</span>
      </el-menu-item>
      <el-menu-item index="/activation">
        <el-icon><home-filled /></el-icon>
        <span>激活码管理</span>
      </el-menu-item>
      <el-menu-item index="/userList">
        <el-icon><home-filled /></el-icon>
        <span>用户列表</span>
      </el-menu-item>
      <el-menu-item index="/clockIn">
        <el-icon><home-filled /></el-icon>
        <span>打卡审核</span>
      </el-menu-item>
      <el-menu-item index="/noteList">
        <el-icon><home-filled /></el-icon>
        <span>笔记列表</span>
      </el-menu-item>
      <el-sub-menu index="2">
        <template #title>
          <el-icon><location /></el-icon>
          <span>新闻管理</span>
        </template>
        <el-menu-item-group title="">
          <el-menu-item index="/newsManage/newsAdd">创建新闻</el-menu-item>
          <el-menu-item index="/newsManage/newsList">新闻列表</el-menu-item>
        </el-menu-item-group> </el-sub-menu
      ><el-sub-menu index="3">
        <template #title>
          <el-icon><location /></el-icon>
          <span>产品管理</span>
        </template>
        <el-menu-item-group title="">
          <el-menu-item index="/productManage/productAdd"
            >创建产品</el-menu-item
          >
          <el-menu-item index="/productManage/productList"
            >产品列表</el-menu-item
          >
        </el-menu-item-group>
      </el-sub-menu>
      <el-sub-menu index="4">
        <template #title>
          <el-icon><location /></el-icon>
          <span>题目管理</span>
        </template>
        <el-menu-item-group title="">
          <el-menu-item index="/questionManage/category">分类</el-menu-item>
          <el-menu-item index="/questionManage/questionList"
            >题目列表</el-menu-item
          >
          <el-menu-item index="/questionManage/questionAdd"
            >添加题目</el-menu-item
          >
        </el-menu-item-group>
      </el-sub-menu>
    </el-menu>
  </el-aside>
</template>

<script setup>
import { HomeFilled } from "@element-plus/icons-vue";
import { useRoute } from "vue-router";
import { computed } from "vue";
import { useStore } from "vuex";
const store = useStore();
const isShow = computed(() => {
  return store.state.userInfo.role == 1 ? true : false;
});
const route = useRoute();
console.log("route", route.fullPath);

// import store from '../../store.index.js'
</script>


<style lang="scss" scoped>
.el-aside {
  height: 100%;
  .el-menu {
    height: 100%;
  }
}
</style>